package cn.fourth;

public class Programmer {
    private String name;
    private int age;
    private String skilled;
    private  int workYears;
    private String post;
    private String duty;


    public  Programmer(){

    }

    public Programmer(String name, int age, String skilled, int workYears, String post, String duty) {
        this.setName(name);
        this.setAge(age);
        this.getSkilled();
        this.setWorkYears(workYears);
        this.setPost(post);
        this.setDuty(duty);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age < 15) {
            this.age = 15;
            System.out.println("IT从业人员年龄必须要满15岁才能工作");
        } else {
            this.age = age;
        }
    }

    public String getSkilled() {
       String skilled="计算机三维视觉研究";
        return skilled;
    }

    public void setSkilled(String skilled) {
        this.skilled = skilled;
    }

    public int getWorkYears() {
        return workYears;
    }

    public void setWorkYears(int workYears) {
        this.workYears = workYears;
    }

    public String getPost() {
        return post;
    }

    public void setPost(String post) {
        this.post = post;
    }

    public String getDuty() {
        return duty;
    }

    public void setDuty(String duty) {
        this.duty = duty;
    }

    public void show(String post,String duty){
        String str="姓名:"+name+"\t年龄:"+this.age+"\t技术方向:"+getSkilled()+"\t工作年龄:"+workYears+"\t工作单位:"+post+"\t职务:"+duty;
        System.out.println(str);
    }
}
